from datetime import datetime
from flask_app.extensions import db


class AuthorMD(db.Model):
    __tablename__ = "author_t"
    # 角色id
    author_id = db.Column(db.String(80),primary_key=True)

    resource_id = db.Column(db.String(80), db.ForeignKey("resource_t.id"), primary_key=True)

    @staticmethod
    def get_authored_resource(id):
        return AuthorMD.query.filter_by(author_id=id).all()
